import { defHttp } from '@/utils/http/axios';
import { ID, IDS } from '@/api/base';
import { OtaLinkProductInfoVO, OtaLinkProductInfoForm, OtaLinkProductInfoQuery } from './model';

/**
 * 查询OTA商品关联信息列表
 * @param params
 * @returns
 */
export function otaLinkProductInfoList(params?: OtaLinkProductInfoQuery) {
  return defHttp.get<OtaLinkProductInfoVO[]>({ url: '/ota/otaLinkProductInfo/list', params });
}

/**
 * 导出OTA商品关联信息列表
 * @param params
 * @returns
 */
export function otaLinkProductInfoExport(params?: OtaLinkProductInfoQuery) {
  return defHttp.post<Blob>(
    { url: '/ota/otaLinkProductInfo/export', params, responseType: 'blob' },
    { isTransformResponse: false },
  );
}

/**
 * 查询OTA商品关联信息详细
 * @param id id
 * @returns
 */
export function otaLinkProductInfoInfo(id: ID) {
  return defHttp.get<OtaLinkProductInfoVO>({ url: '/ota/otaLinkProductInfo/' + id });
}

/**
 * 新增OTA商品关联信息
 * @param data
 * @returns
 */
export function otaLinkProductInfoAdd(data: OtaLinkProductInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/ota/otaLinkProductInfo/add', data });
}

/**
 * 更新OTA商品关联信息
 * @param data
 * @returns
 */
export function otaLinkProductInfoUpdate(data: OtaLinkProductInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/ota/otaLinkProductInfo/update', data });
}

/**
 * 删除OTA商品关联信息
 * @param id id
 * @returns
 */
export function otaLinkProductInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/ota/otaLinkProductInfo/' + id });
}
